package cn.xd.learn.itstack.dbatis.config;

import org.springframework.boot.web.servlet.server.Session;

/**
 * @Classname DefaultSqlSessionFactory
 * @Description TODO
 * @Date 2022/4/22 下午5:38
 * @Created by lvxiaodong
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {

    private Configuration configuration ;

    public DefaultSqlSessionFactory(Configuration configuration){
        this.configuration = configuration;
    }

    @Override
    public SqlSession openSession() {
        return new DefaultSqlSession(configuration.getConnection(),configuration.getMapperElement());
    }
}
